package com.bw.controller.order;
import com.bw.service.comment.ProductReplyService;
import com.bw.service.order.CategoryReportService;
import com.bw.service.order.OrderService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.sql.SQLOutput;
import java.util.Date;

@Component
public class OrderTask {

    @Reference
    private OrderService orderService;

    @Reference
    private ProductReplyService productReplyService;

    @Reference
    private CategoryReportService categoryReportService;

    //定时任务解决方案,12,16-20
    @Scheduled(cron = "0 0 0 * * ?")
    public void orderTimeOutLogic() {
        System.out.println(new Date());
        System.out.println("定时任务解决方案");
        productReplyService.TimeOut();
        //orderService.orderTimeOutLogic();
    }
    //@Scheduled(cron = "10 * * * * ?")
    @Scheduled(cron = "0 0 1 * * ?")
    public void createCategroyReportDate()
    {
        System.out.println("生成类目统计数据");
        categoryReportService.createData();
    }

}